package com.atguigu.lease.common.config;

import com.atguigu.lease.common.handle.StringToBaseTypeEnumConverterFactory;
//import com.atguigu.lease.common.handle.StringToItemTypeEnumConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class StgyWebMvcConfig implements WebMvcConfigurer {
    /*@Autowired
    StringToItemTypeEnumConverter stringToItemTypeEnumConverter;*/
    @Autowired
    StringToBaseTypeEnumConverterFactory stringToBaseTypeEnumConverterFactory;
    @Override
    public void addFormatters(FormatterRegistry registry) {
//        registry.addConverter(stringToItemTypeEnumConverter);
        registry.addConverterFactory(stringToBaseTypeEnumConverterFactory);
    }
}
